package com.qp.basics.estivate;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * @author Administrator
 *
 */
public class Index {
	private String name;
	private String isUnique;
	private Object id;
	private Set<Column> columns = new HashSet<Column>();
	private Table tablel;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIsUnique() {
		return isUnique;
	}

	public void setIsUnique(String isUnique) {
		this.isUnique = isUnique;
	}

	public Object getId() {
		return id;
	}

	public void setId(Object id) {
		this.id = id;
	}

	public void addColumn(Column column) {
		this.columns.add(column);
	}

	public boolean checkColumn(Column column) {
		if (columns.contains(column)) {
			return true;
		} else {
			return false;
		}
	}

	public Set<Column> getColumns() {
		return Collections.unmodifiableSet(columns);
	}

	public void setColumns(Set<Column> columns) {
		this.columns = columns;
	}

	public Table getTablel() {
		return tablel;
	}

	public void setTablel(Table tablel) {
		this.tablel = tablel;
	}

	/**
	 * @return
	 */
	// public String getType() {
	// if (isPrimary())
	// return "Primary key";
	// if (isUnique())
	// return "Must be unique";
	// return "Performance";
	// }
}
